package org.example.controller;

import org.example.beans.Pay;
import org.example.beans.Person;
import org.example.beans.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/first")
public class FirstController {

    private Person person;
    private User user;
    private Pay pay;

    // 一个空值，通过构造方法的形式是注入不进来的
    public FirstController(Person person, User user, Pay pay) {
        this.person = person;
        this.user = user;
        this.pay = pay;
    }

    @GetMapping
    public String greet() {
//        System.out.println(person.getId() + "#" + person.getName() + "#" + person.getInterests().get(1));
//        System.out.println(user.getId() + "#" + user.getName() + "#" + user.getInterests().get(1));
        System.out.println(pay.getAppKey() + "#" + pay.getTradeId());
        return "Hi ^@^";
    }
}
